package com.leyou.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * description: 异常枚举
 * @author 朱正磊
 * @date 2021-03-25 16:52:51
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum ExceptionEnum {

    // 业务异常枚举实例
    CATEGORY_NOT_FOUND(404, "商品分类没查到"),
    BRAND_NOT_FOUND(404, "商品品牌没查到"),
    SPEC_GROUP_NOT_FOUND(404, "商品规格参数组不存在"),
    SPEC_PARAM_NOT_FOUND(404, "商品规格参数不存在"),
    GOODS_NOT_FOUND(404, "商品不存在"),
    GOODS_DETAIL_NOT_FOUND(404, "商品详情不存在"),
    GOODS_SKU_NOT_FOUND(404, "商品SKU不存在"),
    GOODS_STOCK_NOT_FOUND(404, "商品库存不存在"),
    BRAND_SAVE_ERROR(500, "新增品牌失败"),
    UPLOAD_FILE_ERROR(500, "上传文件失败"),
    GOODS_SAVE_ERROR(500, "新增商品失败"),
    GOODS_UPDATE_ERROR(500, "更新商品失败"),
    INVALID_FILE_TYPE(400, "无效的文件类型"),
    GOODS_ID_CANNOT_BE_NULL(400, "商品id不能为空"),
    INVALID_USER_DATA_TYPE(400, "用户数据类型无效"),
    INVALID_VERIFY_CODE(400, "无效的短信验证码"),
    INVALID_USERNAME_PASSWORD(400, "用户名或密码错误"),
    CREATE_TOKEN_ERROR(500, "生成用户凭证失败"),
    UNAUTHORIZED(401, "没有访问权限");

    private Integer code;
    private String msg;

}
